<!DOCTYPE html>
<html>
  <head>
    <title>Raphael</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="../includes/raphael/raphael-min.js" type="text/javascript"></script>
    <script src="../includes/jqueryui/js/jquery.1.6.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        (function($){
            var canvas = /(circle|rect|text)/ 
            $.fn.raphael = function(){
                args = arguments
                return this.each(function(){
                    var arg = [this] ;
                    for(x in args){
                        arg.push(args[x])
                    }
                    this.raphael = Raphael(arg)
                })
            }
            $.fn.raphael.circle = function(){
                console.log(this)
                console.log(arguments)
                this.each(function(){
                    this.raphael.circle(arguments)
                })
            }
        })(jQuery);

        $(function(){
            $('.test').raphael(200, 200, {
                    type: "rect",
                    x: 10,
                    y: 10,
                    width: 150,
                    height: 150,
                    stroke: "#505"
                }, {
                    type: "text",
                    x: 30,
                    y: 40,
                    text: "Dump"
                }
            )
            $('.test').raphael.circle(10, 10, 5);
        });
    </script>
    <style type="text/css">

    </style>
  </head>
  <body>
      <div class="test"></div>
      <div class="test"></div>
      <div class="test"></div>
  </body>
</html>
